package com.xiaolaoban.user_center_back_end.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaolaoban.user_center_back_end.model.User;

import javax.servlet.http.HttpServletRequest;

/**
 * @author boss
 * @description 针对表【user(用户)】的数据库操作Service
 * @createDate 2024-03-04 19:08:06
 */
public interface UserService extends IService<User> {

    /**
     * 用户注册
     *
     * @param userAccount   用户账号
     * @param userPassword  用户密码
     * @param checkPassword 校验密码
     * @return 新用户id
     */
    long userRegister(String userAccount, String userPassword, String checkPassword);

    /**
     * 用户登录
     *
     * @param userAccount  用户账号
     * @param userPassword 用户密码
     * @param httpServletRequest tomcat servlet
     * @return 用户信息
     */
    User userLogin(String userAccount, String userPassword, HttpServletRequest httpServletRequest);

    /**
     * 用户信息脱敏
     * @param originUser 原始user
     * @return 脱敏后的user
     */
    User getSafetyUser(User originUser);

    /**
     * 用户注销
     * @param request
     * @return
     */
    int userLogout(HttpServletRequest request);
}

